package xyz.zhzby.cyzx.oj.convert;

import io.swagger.annotations.ApiModel;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.factory.Mappers;
import xyz.zhzby.cyzx.oj.dto.response.CategoryResponse;
import xyz.zhzby.cyzx.oj.entity.Category;

import java.util.List;

/**
 * @author zby
 * @date 2022/01/14
 */

@ApiModel("试题分类相关转换器")
@Mapper(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface CategoryConvert {

    CategoryConvert INSTANCE = Mappers.getMapper(CategoryConvert.class);

    CategoryResponse CATEGORY_RESPONSE(Category category);

    List<CategoryResponse> CATEGORY_RESPONSE_LIST(List<Category> categories);
}
